package util;

import javax.swing.ImageIcon;

public class Sprite {
	protected ImageIcon[] cenas;
	protected int x;
	protected int y;
	protected int width;
	protected int heigth;
	protected int cena = 0;
	protected int controlSpeed = 0;
	protected int speed = 7;
	
	public Sprite(int numCenas, int x, int y){
		this.cenas = new ImageIcon[numCenas];
		this.x = x;
		this.y = y;
	}
	
	public void animar(){
		cena++;
		if(cena == cenas.length)
			cena = 0;
	}
	
	public void animarControle(){
		controlSpeed ++;
		if(controlSpeed > speed){
			controlSpeed = 0;
			animar();
		}
	}

	/**
	 * @return the cenas
	 */
	public ImageIcon[] getCenas() {
		return cenas;
	}

	/**
	 * @param cenas the cenas to set
	 */
	public void setCenas(ImageIcon[] cenas) {
		this.cenas = cenas;
	}

	/**
	 * @return the x
	 */
	public int getX() {
		return x;
	}

	/**
	 * @param x the x to set
	 */
	public void setX(int x) {
		this.x = x;
	}

	/**
	 * @return the y
	 */
	public int getY() {
		return y;
	}

	/**
	 * @param y the y to set
	 */
	public void setY(int y) {
		this.y = y;
	}

	/**
	 * @return the width
	 */
	public int getWidth() {
		return width;
	}

	/**
	 * @param width the width to set
	 */
	public void setWidth(int width) {
		this.width = width;
	}

	/**
	 * @return the heigth
	 */
	public int getHeigth() {
		return heigth;
	}

	/**
	 * @param heigth the heigth to set
	 */
	public void setHeigth(int heigth) {
		this.heigth = heigth;
	}

	/**
	 * @return the cena
	 */
	public int getCena() {
		return cena;
	}

	/**
	 * @param cena the cena to set
	 */
	public void setCena(int cena) {
		this.cena = cena;
	}

	/**
	 * @return the controlSpeed
	 */
	public int getControlSpeed() {
		return controlSpeed;
	}

	/**
	 * @param controlSpeed the controlSpeed to set
	 */
	public void setControlSpeed(int controlSpeed) {
		this.controlSpeed = controlSpeed;
	}

	/**
	 * @return the speed
	 */
	public int getSpeed() {
		return speed;
	}

	/**
	 * @param speed the speed to set
	 */
	public void setSpeed(int speed) {
		this.speed = speed;
	}
}
